/*******************************************************************************
 * 
 * Copyright:
 * 
 * License:
 * 
 * Authors:
 * 
 ******************************************************************************/

/*******************************************************************************
 * 
 * #asset(ui_mov/*) #asset(qx/mobile/icon/${qx.mobile.platform}/*)
 * #asset(qx/mobile/icon/common/*)
 * 
 ******************************************************************************/

/**
 * This is the main application class of your custom application "ui_mov"
 */
qx.Class.define("ui_mov.views.noticia", {
			extend : qx.ui.mobile.page.NavigationPage,
			construct : function() {
				this.base(arguments);
				this.set({
							title : "Noticia", // will be replaced by username
							showBackButton : true,
							backButtonText : "Volver"
						});

				this.addListener("back", function() {
							window.pages.noticias.show({
										reverse : true
									});
						}, this);
				this.fecha = new qx.ui.mobile.basic.Label('');
				this.add(this.fecha);
				this.contenido = new qx.ui.mobile.basic.Label('');
				this.add(this.contenido);
			},
			members : {
				format : function(d) {
					return (d.getDate() + "/" + d.getMonth() + "/" + d
							.getFullYear());
				},
				setNoticia : function(fecha, contenido) {
					this.fecha.setValue(this.format(new Date(fecha)));
					this.contenido.setValue(contenido);
				}
			}
		});
